package com.googlecode.lookie.platform.config;

import java.util.HashMap;

import org.springframework.context.MessageSource;
import org.springframework.context.support.StaticMessageSource;
import org.springframework.richclient.application.config.DefaultApplicationObjectConfigurer;
import org.springframework.richclient.image.DefaultIconSource;
import org.springframework.richclient.image.DefaultImageSource;
import org.springframework.richclient.image.IconSource;
import org.springframework.richclient.image.ImageSource;

public class BundleObjectConfigurer
    extends DefaultApplicationObjectConfigurer
{

    private IconSource iconSource;

    private ImageSource imageSource;

    private MessageSource messageSource;

    protected IconSource getIconSource()
    {
        if (iconSource == null) {
            iconSource = new DefaultIconSource();
        }
        return iconSource;
    }

    public void setIconSource( IconSource iconSource )
    {
        this.iconSource = iconSource;
    }

    protected ImageSource getImageSource()
    {
        if (imageSource == null) {
            imageSource = new DefaultImageSource(new HashMap());
        }
        return imageSource;
    }

    public void setImageSource( ImageSource imageSource )
    {
        this.imageSource = imageSource;
    }

    protected MessageSource getMessageSource()
    {
        if (messageSource == null) {
            messageSource = new StaticMessageSource();
        }
        return messageSource;
    }

    public void setMessageSource( MessageSource messageSource )
    {
        this.messageSource = messageSource;
    }

}
